<?php
namespace app\common\middleware;

use app\admin\middleware\BindLoginUser as AdminBindLoginUser;
use app\user\middleware\BindLoginUser as DefaultBindLoginUser;

/**
 * 绑定登录用户
 */
class BindLoginUser
{
    public function handle($request, \Closure $next)
    {
        if ($request->isAdminRoute) {
            $user = new AdminBindLoginUser();
        } else {
            $user = new DefaultBindLoginUser();
        }

        return $user->handle($request, $next);

    }
}
